package com.hgd.igreencar.controller;


import com.hgd.igreencar.biz.IActualAirQualityBiz;
import com.hgd.igreencar.entity.ActualAirQuality;
import com.hgd.igreencar.entity.SpeficCityDateData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.List;

@Controller
@RequestMapping("/ActualAirQuality")
public class ActualAirQualityController {
    @Autowired
    private IActualAirQualityBiz iActualAirQualityBiz;

    /**
     * 关键词搜索(没有关键词返回全部）对应空气成分数据
     */
    @PostMapping("/querySpecificItem")
    public @ResponseBody
    List<ActualAirQuality> querySpecificActualAirQuality(@RequestBody ActualAirQuality actualAirQuality) throws ParseException {
        return iActualAirQualityBiz.querySpecificActualAirQuality(actualAirQuality);
    }
    /**
     * 返回某个城市所有日期或指定日期的数据
     */
    @PostMapping("/querySpecificCityDateData")
    public @ResponseBody
    List<SpeficCityDateData> querySpecificCityDateData(@RequestBody ActualAirQuality actualAirQuality) throws ParseException {
        return iActualAirQualityBiz.querySpecificCityDateData(actualAirQuality);
    }

}

